package com.zztest.aitestmini.service.impl;

import com.zztest.aitestmini.contants.Constants;
import com.zztest.aitestmini.dao.ZzTestCaseMapper;
import com.zztest.aitestmini.dto.ResultDto;
import com.zztest.aitestmini.entity.ZzTestCase;
import com.zztest.aitestmini.service.ZzTestCaseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * @Author: zhangcheng
 * @Description: 测试用例层实现类
 * @Date: 2021/3/29/029 19:34
 * @Version: 1.0
 */
@Service
@Slf4j
public class ZzTestCaseServiceImpl implements ZzTestCaseService {
    @Autowired //引入casemapper
    private ZzTestCaseMapper zzTestCaseMapper;

    @Override
    public ResultDto<ZzTestCase> save(ZzTestCase zzTestCase) {
        zzTestCase.setCreateTime(new Date());
        zzTestCase.setUpdateTime(new Date());
        //设置标识位
        zzTestCase.setDelFlag(Constants.DEL_FLAG_ONE);
        zzTestCaseMapper.insertUseGeneratedKeys(zzTestCase);
        return ResultDto.success("成功",zzTestCase);
    }
}
